<?php 
session_cache_expire(999999999);
if(!isset($_SESSION)) 
{ 
	session_start(); 
}
$lang = $_SESSION['lang'];
if (empty($lang) || $lang == "EN") {
	include "../value/value_en.php";
} else if($lang == "VN") {
	include "../value/value_vn.php";
}
else {
	include "../value/value_kr.php";
}

$mang=$_SESSION['listCalendar'];
$dem=1;
$listmang=array();
foreach ($mang as $value => $giatri){
	if($giatri[0]!=$_REQUEST['idCalendar']){
		$listmang[]=array($giatri[0],$giatri[1],$giatri[2],$giatri[3],$giatri[4]);
		$dem++;
	}
	else
		$listmang[]=array($giatri[0],$giatri[1],$giatri[2],1,$giatri[4]);
}
$mang=$listmang;
$_SESSION['listCalendar']=$mang;
?>
<input id="countmang1" name="countmang1" value='<?=$dem?>'  type="hidden" />
<table cellpadding="0" cellspacing="1" border="0" class="ftable1" style="width: 100%;margin:auto;">
			<tr align='center'>
				<th style="width:10px;"><img onclick="addCalendar1();" src="images/plus.png" style="width:20px;height:20px;cursor:pointer;" title="<?php echo $l_add;?>" /></th>
				<th><?=$l_name_calendar;?></th>
				<th ><?=$l_content_calendar;?></th>
				<th style="width: 90px;">Date</th>
			</tr>
			
		<?php 
		$k=1;
		foreach ($mang as $value => $giatri){
			if($giatri[3]==0){
			?>
			<tr align='center' style="height: 40px">
				<td><img onclick="delCalendar1(<?php echo $giatri[0];?>)" src="images/del.png" style="width:20px;height:20px;cursor:pointer;" title="<?php echo $l_delete;?>" /></td>
				<td><input id="idCalendar<?=$k?>" name="idCalendar[]" value='<?=$giatri[0]?>'  type="hidden"/><input id="nameCalendar<?=$k?>" name="nameCalendar[]" onchange="chnameCalendar(this.value,<?=$giatri[0]?>)" onkeyup="chnameCalendar(this.value,<?=$giatri[0]?>)" value='<?=$giatri[1]?>' style="height: 24px;width: 200px;"/></td>
				<td><textarea id="contentCalendar<?=$k?>" name="contentCalendar[]" onchange="chcontentCalendar(this.value,<?=$giatri[0]?>)" onkeyup="chcontentCalendar(this.value,<?=$giatri[0]?>)" style="height: 40px;width: 300px;"><?=$giatri[4]?></textarea></td>
				<td><input id="date<?=$k?>" name="date[]" onchange="chdateStart(this.value,<?=$giatri[0]?>)" onkeyup="chdateStart(this.value,<?=$giatri[0]?>)" value='<?=$giatri[2]?>' style="height: 24px;width: 100px;text-align: center;"/></td>
				
			</tr>
		<?php 
				$k++;
			}
				}
				if($k==1){?>
							<tr>
								<td class="tdfirst" colspan="3"><?=$l_list_emplty?></td>
								
							</tr>
		<?}?>
			
		</table> 